<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<title><<<.Configs.SiteTitle>>></title>

		<link rel="stylesheet" href="/static/component/layui/css/layui.css" />
		<link rel="stylesheet" href="/static/admin/css/pearMenu.css" />
		<link rel="stylesheet" href="/static/admin/css/pearTab.css" />
		<link rel="stylesheet" href="/static/admin/css/pearTheme.css" />
		<link rel="stylesheet" href="/static/admin/css/pearLoad.css" />
		<link rel="stylesheet" href="/static/admin/css/pearFrame.css" />
		<link rel="stylesheet" href="/static/admin/css/pearAdmin.css" />
		<link rel="stylesheet" href="/static/admin/css/pearNotice.css" />
		<link rel="stylesheet" href="/static/admin/css/pearSocial.css" />
		<link rel="stylesheet" href="/static/admin/css/pearOper.css"/>
		<style id="pearone-bg-color"></style>
	</head>
	<body class="layui-layout-body  pear-admin">
		<!-- 布局框架 -->
		<div class="layui-layout layui-layout-admin">
			<div class="layui-header">
				<ul class="layui-nav layui-layout-left">
					<li class="collaspe layui-nav-item"><a href="#" class="layui-icon layui-icon-shrink-right"></a></li>
					<li class="refresh layui-nav-item"><a href="#" class="layui-icon layui-icon-refresh-1"></a></li>
				</ul>
				<div id="control" class="layui-layout-control"></div>
				<ul class="layui-nav layui-layout-right">
					<li class="layui-nav-item layui-hide-xs"><a href="<<<.Configs.SiteUrl>>>" class="layui-icon layui-icon-website"></a></li>
					<li class="layui-nav-item" lay-unselect="">
						<a href="javascript:;"><img src="/static/admin/images/avatar.jpg" class="layui-nav-img"><<<.User.NickName>>></a>
						<dl class="layui-nav-child">
							<dd><a id="changePass">修改密码</a></dd>
							<dd><a id="logout">注销登陆</a></dd>
						</dl>
					</li>
					<li class="setting layui-nav-item"><a href="#" class="layui-icon layui-icon-more-vertical"></a></li>
				</ul>
			</div>
			<div class="layui-side layui-bg-black">
				<div class="layui-logo">
					<img class="logo" src="/static/admin/images/logo.png" />
					<span class="title"><<<.Configs.SiteTitle>>>后台</span>
				</div>
				<div class="layui-side-scroll">
					<div id="sideMenu"></div>
				</div>
				<ul class="bottom-nav">
					<li class="head-nav-item">
						<a href="javascript:;"><i class="layui-icon layui-icon-notice"></i></a>
					</li>
					<li class="head-nav-item theme">
						<a href="javascript:;"><i class="layui-icon layui-icon-theme"></i></a>
					</li>
					<li class="head-nav-item">
						<a href="javascript:;"><i class="layui-icon layui-icon-username"></i></a>
					</li>
					<li class="head-nav-item">
						<a href="javascript:;"><i class="layui-icon layui-icon-edit"></i></a>
					</li>
				</ul>
			</div>
			<div class="layui-body">
				<div id="content"></div>
			</div>
		</div>

		<!-- 移动端 遮盖层 -->
		<div class="pear-cover"></div>

		<!-- 初始加载 动画-->
		<div class="preloader">
			<div class="preloader-inner"></div>
			<div class="preloader-message">系统初始化...</div>
		</div>

		<script src="/static/component/layui/layui.js"></script>
		<script src="/static/blog/jquery-3.1.1.min.js"></script>
		<script>
			$("#logout").click(
				function () {

					layui.use(['pearOper', 'jquery'], function () {
						let $ = layui.jquery,
							pearOper = layui.pearOper;

						pearOper.confirm(
								{ title : "是否退出" , message : "确认是否注销账号" , success : function() {
										$.ajax({
											url: '/api/admin/logout',
											type: 'post',
											data: JSON.stringify({}),
											dataType: "json",
											contentType: 'application/json',
											success: function (response) {
												if (response.code === 1) {
													layer.alert(response.msg);
												} else {
													location.href = "/admin/login"
												}
											}
										})
									}});
					})
				}
			)


		</script>
		<script>
			$("#changePass").click(
					function () {
						layui.use('layer', function () {
							layer.open({
								type: 2,
								title: '修改密码',
								shade: 0.5,
								area: ['500px', '250px'],
								content: "/admin/user/changepass/"+<<<.User.Id>>>
							});
						})
					}
			)
		</script>
		<script>
			layui.use(['pearAdmin', 'jquery', 'pearTab', 'pearNotice'], function() {
				let pearAdmin = layui.pearAdmin;
				let $ = layui.jquery;
				let pearTab = layui.pearTab;
				let pearNotice = layui.pearNotice;

				let config = {
					keepLoad: 1200, // 主 页 加 载 过 度 时 长 可为 false
					muiltTab: true, // 是 否 开 启 多 标 签 页 true 开启 false 关闭
					control: false, // 是 否 开 启 多 系 统 菜 单 true 开启 false 关闭
					theme: "dark-theme", // 默 认 主 题 样 式 dark-theme 默认主题 light-theme 亮主题
					index: '/admin/console', // 默 认 加 载 主 页
					data: '/static/admin/data/menu.json', // 菜 单 数 据 加 载 地 址
					done: function() {
						/** 框架初始化 */
					}
				};
				
				pearAdmin.render(config);

				/**
				 * 消 息 初 始 化
				 * */
				pearNotice.render({
					elem: 'headerNotice',
					url: '/static/admin/data/notice.json',
					height: '200px',
					click: function(id, title) {
						layer.msg("当前监听消息" + id + "消息标题:" + title);
					}
				})
			})
		</script>
	</body>
</html>
